import request from '@/utils/request'
import * as StoreCouponUserApi from '@/api/discount/storecouponuser';

// 创建优惠券记录
export function createStoreCouponUser(data) {
  return request({
    url: '/discount/store-coupon-user/create',
    method: 'post',
    data: data
  })
}

// 更新优惠券记录
export function updateStoreCouponUser(data) {
  return request({
    url: '/discount/store-coupon-user/update',
    method: 'put',
    data: data
  })
}

// 删除优惠券记录
export function deleteStoreCouponUser(id) {
  return request({
    url: '/discount/store-coupon-user/delete?id=' + id,
    method: 'delete'
  })
}

// 获得优惠券记录
export function getStoreCouponUser(id) {
  return request({
    url: '/discount/store-coupon-user/get?id=' + id,
    method: 'get'
  })
}

// 获得优惠券记录分页
export function getStoreCouponUserPage(params) {
  return request({
    url: '/discount/store-coupon-user/page',
    method: 'get',
    params
  })
}
// 导出优惠券记录 Excel
export function exportStoreCouponUserExcel(params) {
  return request({
    url: '/discount/store-coupon-user/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

export function getuserCoupon(params) {
  return request({
    url: '/discount/store-coupon-user/getuserCoupon',
    method: 'get',
    params
  });
}

export function createStoreCouponUserDirectForSingleUser(params) {
  return request({
    url: '/discount/store-coupon-user/direct-create',
    method: 'post',
    params
  });
}